/*
 * Copyright 2006 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.google.gwt.user.client.rpc;

/**
 * A client-side RPC proxy can always be safely cast to this interface to allow
 * you to or set the target URL for that service.
 */
public interface ServiceDefTarget {

  /**
   * This exception is thrown when a service is invoked without
   * {@link ServiceDefTarget#setServiceEntryPoint(String)} having been called.
   */
  public static class NoServiceEntryPointSpecifiedException extends
      InvocationException {

    public NoServiceEntryPointSpecifiedException() {
      super("Service implementation URL not specified");
    }
  }

  /**
   * Gets the URL of a service implementation.
   * 
   * @return the last value passed to {@link #setServiceEntryPoint(String)}
   */
  String getServiceEntryPoint();

  /**
   * Sets the URL of a service implementation.
   * 
   * @param address a URL that designates the service implementation to call
   */
  void setServiceEntryPoint(String s);
}
